import React from 'react';

class CommentInput extends React.Component {
  render() {
    const { userName, userContent, handleForm, handleFormSubmit } = this.props;
    return (
      <div
        className="comment-list"
        style={{ marginLeft: '20px', marginTop: '10px' }}
      >
        <input
          name="userName"
          type="text"
          className="user"
          placeholder="请输入评论人"
          value={userName}
          onChange={handleForm}
        />
        <br />
        <textarea
          name="userContent"
          className="content"
          cols="30"
          rows="10"
          placeholder="请输入评论内容"
          style={{ marginTop: '5px' }}
          value={userContent}
          onChange={handleForm}
        ></textarea>
        <br />
        <button onClick={() => handleFormSubmit()}>发表评论</button>
      </div>
    );
  }
}

export default CommentInput;
